 #{extends 'main.html' /} #{set title:'Home' /} #{set 'moreStyles'}
#{set 'moreScripts'}



<link rel="stylesheet" href="@{'/public/stylesheets/forms.css'}">

<link rel="stylesheet" href="@{'/public/stylesheets/css3buttons.css'}">


<script type="text/javascript"
	src="@{'/public/javascripts/FancyBox/jquery.fancybox-1.3.4.pack.js'}"></script>

<link rel="stylesheet" type="text/css"
	href="@{'/public/stylesheets/jquery.fancybox-1.3.4.css'}"
	media="screen">

<script type="text/javascript"
	src="@{'/public/javascripts/FancyBox/jquery.easing-1.3.pack.js'}"></script>

<script type="text/javascript"
	src="@{'/public/javascripts/FancyBox/jquery.mousewheel-3.0.4.pack.js'}"></script>

<script type="text/javascript">
jQuery(document).ready(function() {

	jQuery("#controlpanel").fancybox({
			'width' : '80%',
			'height' : '100%',
			'autoScale' : true,
			'transitionIn' : 'none',
			'transitionOut' : 'none',
			'type' : 'iframe',
			'onClosed': function() {
				    parent.location.reload(true); ;
				  }
		});

	});
</script>


#{/set} #{/set}


<div id=left>
	<table border='0.5' align=center>

		<tr>
			<td WIDTH="35%">
				<h2 align="left">Organization Details</h2> #{if organization.picture.exists()}
				<img src="@{Organizations.showImage(organization.id)}" alt="${organization.name} image" width=70% />
				#{/if}



				</div>

				<p>
					<b>Name: </b> ${organization.name}
				</p>
				<p>
					<b>Email: </b> ${organization.email}
				</p>
				<p>
					<b>Address: </b> ${organization.address}
				</p>
				<p>
					<b>Category: </b> ${organization.category}
				</p>
				<p>
					<b>Type: </b> ${organization.type}
				</p>
				<p>

					<b>Leader: </b> ${organization.lead.name}
				</p>
				<p>

					<!-- LINKS AREA -->

   
					#{if organization.lead==user || userType=="systemAdmin"} <a class="btn activity" id="controlpanel"
						href="@{Organizations.showControlPanel(organization.id)}" target="innerframe"> <span></span>Control
						Panel</a> <br /> <br /> <br /> #{/if}
					<!-- IN CASE THE User is in the organization members  -->

					#{if check==true || userType=="systemAdmin"}
					
					#{if organization.lead!=user && userType!="systemAdmin"}

					 #{if b==false} <a
						href="@{Organizations.addSubscriber (organization.id)}" class="btn rss"><span></span>Follow</a><br /> <br /> <br />
					#{/if} #{if b==true} <a
						href="@{Organizations.removeSubscriber (organization.id)}" class="btn rss"><span></span>Unfollow</a><br /> <br /> <br />
					#{/if} 
					#{/if} 
					#{if organization.lead!=user && check==true && userType!="systemAdmin" }
					<a href="@{Organizations.unjoinOrganization(organization.id)}"
						class="btn unjoin"><span></span>Unjoin</a><br /> <br /> <br />
						#{/if} 
					<a href="@{Tags.tagHome(organization.id)}" class="btn tags"
						target="innerframe"><span></span>Tags</a><br /> <br /> <br /> <a
						href="@{PostingIdea.showOrgIdeasHome(organization.id)}" class="btn bulb"
						target="innerframe"><span></span>Air Ideas</a><br /> <br /> <br />
					<a href="@{Relations.relatePage(organization.id)}" class="btn relation"
						target="innerframe"><span></span>Relations</a><br /> <br /> <br /> 
						<a href="@{Organizations.orgMembers(organization.id)}"
						class="btn members" target="innerframe"><span></span>Members </a><br /> <br /> <br /> <a
						href="@{Organizations.viewAllEntities(organization.id)}" class="btn entity"
						target="innerframe"><span></span>Entities</a><br />  <br /> 
							#{if canInviteIdeaDeveloper == true}
#{if organization.lead==user || userType=="organizer" || userType=="systemAdmin"}
<a href="@{Invitations.showUsersNotInOrg(organization.id)}"  target="innerframe"class=" button"><span class="mail icon"></span>Invite Others to be Idea Developers</a>#{/if}

#{/if}
#{/if}



					<!-- IN CASE he is not a member  -->
					#{if isBlocked==true}
					#{if blockRequest == false}
					<a href="@{Organizations.blockedRequest(organization.id)}" class=" button">Request to unblock</a>
					#{/if}
					#{if blockRequest == true}
					<a href ="#"  >You have requested to re-join before</a>
					#{/if}
					#{/if}

		#{if isBlocked==false}
							
 #{if check==false}
 		
					#{if organization.type=="Private" && userType!="systemAdmin"} 
					#{if requested == true}<a href="#" >You have already requested before..Be patient </a> #{/if}
					#{if requested == false}
					<a href="javascript: jQuery.facebox({ajax:'@{Organizations.request(organization.id)}'});" class=" button">Request to join</a>#{/if}
						#{/if}
						#{else}
					#{if organization.type=="Public" && userType!="systemAdmin"}	
						#{if b==false} <a
						href="@{Organizations.addSubscriber (organization.id)}" class="btn rss"><span></span>Follow</a>
				#{/if} #{if b==true} <a
						href="@{Organizations.removeSubscriber (organization.id)}" class="btn rss"><span></span>Unfollow</a>
  	#{/if}
  
<a	href="@{Organizations.addMember((organization.id))}" class="btn join"><span></span>Join</a>
			 <a href="@{Organizations.orgMembers(organization.id)}"
						class="btn members" target="innerframe"><span></span>Members </a>
						#{/if}
						#{/else}
						#{/if}
							#{/if}
						
			</td>
			<td WIDTH="75%"><br /> <br /> <iframe name="innerframe"
					scrolling=auto FRAMEBORDER=NO src="" width="660px" height="600"></iframe>
			</td>
	</table>
</div>
</ul>
</td>
</table>

</div>


